df_sub <- dta_midterm

df_sub$w9_2022_1_elections1_raw = df_sub$w9_2022_1_elections1
df_sub$w9_2022_1_elections1 <- recode(df_sub$w9_2022_1_elections1, '1' = "Agree", "2" = "Agree", "3" = "Don't Know", "4" = "Disagree", "5" = "Disagree")
df_sub$w9_2022_1_elections3 <- recode(df_sub$w9_2022_1_elections3, '1' = 'Yes', '2' = 'No', '3' = "Don't know")

fig_s2 = df_sub |> 
  ggplot(aes(x = w9_2022_1_elections1_raw, weight = weight)) +
  geom_histogram(bins = 5) +
  facet_wrap(~pid, ncol = 1, scales = "free_y") +
  scale_x_continuous(breaks = 1:5,labels = c("Strongly\nAgree","Agree",
                                             "Neither Agree\nnor Disagree",
                                             "Disagree","Strongly\nDisagree")) +
  theme_prl() + 
  theme(panel.grid.major = element_blank(),
        plot.title = element_text(size=12),
        legend.text=element_text(size=9),          
        axis.title.y=element_blank(),
        axis.title.x=element_blank(), 
        legend.position = "none")

ggsave(here("Figures", "figure_s2.pdf"), fig_s2,
       width=6, height=4, units = 'in', dpi = 600)
